Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.paginationBev = void 0;

var t = Behavior({
    data: {
        loading: !1,
        pageSize: 20,
        dataArray: [],
        total: null,
        noneResult: !1,
        currPage: 1
    },
    methods: {
        isLoading: function() {
            return this.data.loading;
        },
        loading: function() {
            var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
            t && wx.showLoading({
                title: "加载中",
                mask: !0
            }), this.setData({
                showLoading6895: t,
                loading: !0
            });
        },
        stopLoad: function() {
            this.data.showLoading6895 && wx.hideLoading(), this.setData({
                loading: !1
            });
        },
        getNextPageIndex: function(t, a) {
            return (t || []).length / a + 1;
        },
        setMoreData: function(t) {
            var a = this.data.dataArray.concat(t);
            this.setData({
                dataArray: a
            });
        },
        getPageNum: function() {
            return this.data.currPage + 1;
        },
        setTotal: function(t, a) {
            this.setData({
                total: t,
                currPage: a
            }), 0 == t ? this.setData({
                noneResult: !0
            }) : this.setData({
                noneResult: !1
            });
        },
        hasMore: function() {
            return !(this.data.dataArray.length >= this.data.total);
        },
        initialize: function() {
            this.setData({
                dataArray: [],
                noneResult: !1,
                loading: !1
            }), this.data.total = null;
        }
    }
});

exports.paginationBev = t;